local qiuzhuangshandian = fk.CreateSkill{
  name = "dajubei__qiuzhuangshandian",
}

Fk:loadTranslationTable{
  ["dajubei__qiuzhuangshandian"] = "球状闪电",
  [":dajubei__qiuzhuangshandian"] = "出牌阶段限一次，你可以重复此流程：若有角色手牌比你多一张，你可以摸一张牌。",

  ["#dajubei__qiuzhuangshandian"] = "球状闪电：是否摸一张牌？",

  ["$dajubei__qiuzhuangshandian1"] = "为台风做好准备吧！",
  ["$dajubei__qiuzhuangshandian2"] = "风暴时间！",
}

qiuzhuangshandian:addEffect("active", {
  anim_type = "drawcard",
  prompt = "#dajubei__qiuzhuangshandian",
  card_num = 0,
  target_num = 0,
  can_use = function (self, player)
    return player:usedSkillTimes(qiuzhuangshandian.name, Player.HistoryPhase) == 0
    and table.find(Fk:currentRoom().alive_players, function (p) return p:getHandcardNum() - player:getHandcardNum() == 1 end)
  end,
  card_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    player:drawCards(1, qiuzhuangshandian.name)
    while not player.dead and table.find(room.alive_players, function (p) return p:getHandcardNum() - player:getHandcardNum() == 1 end)
    and room:askToSkillInvoke(player, { skill_name = qiuzhuangshandian.name, prompt = "#dajubei__qiuzhuangshandian"}) do
      player:drawCards(1, qiuzhuangshandian.name)
    end
  end,
})

return qiuzhuangshandian